package com.cn.dream_order_server.controller;


import com.cn.dream_order_server.pojo.OrderOrder;
import com.cn.dream_order_server.pojo.OrderOrderdetails;
import com.cn.dream_order_server.service.LogisticsManagementService;
import com.cn.dream_order_server.service.OrderOrderBackstageService;
import com.cn.dream_order_server.service.OrderOrderdetailsService;
import com.cn.dream_order_server.vo.LogisticsManagementVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@Controller
public class OrderOrderdetailsBackstageController {

    @Autowired
    private OrderOrderBackstageService orderOrderBackstageService;

    @Autowired
    private OrderOrderdetailsService orderOrderdetailsService;

    @Autowired
    private LogisticsManagementService logisticsManagementService;

    @RequestMapping("/wlcOrderDetailed")
    public String wlcOrderDetailed(String orderId,Integer pageNo,Map map){
        //获取订单对象
        OrderOrder orderOrder = orderOrderBackstageService.getOrderOrderByOrderId(orderId);
        //获取订单详情集合
        List<OrderOrderdetails> orderOrderdetailsList = orderOrderdetailsService.getOrderOrderdetailsListByOrderId(orderId);
        //获取物流管理信息
        List<LogisticsManagementVO> logisticsManagementMsgList = logisticsManagementService.getLogisticsManagementMsg(orderId);
        map.put("orderOrder",orderOrder);
        map.put("orderOrderdetailsList",orderOrderdetailsList);
        map.put("logisticsManagementMsgList",logisticsManagementMsgList);
        map.put("pageNo",pageNo);
        return "order_detailed";
    }
}
